package cz.matasek.dbLogger.exception;

import cz.matasek.dbLogger.database.DatabaseObjectType;

/**
 * Thrown to indicate that table does not exist.
 *
 * @author Luboš Matásek
 */
public class ObjectDoesNotExistException extends DbLoggerRuntimeException {

    /**
     * Default exception message.
     */
    private static final String EXCEPTION_MESSAGE = "does not exist";
    /**
     * Serial version UID.
     */
    private static final long serialVersionUID = -1896095246219979647L;

    /**
     * Creates a new <code>ObjectDoesNotExistException</code> with a message containing name
     * of the non-existing object.
     *
     * @param type database object type
     * @param objectName name of the object
     */
    public ObjectDoesNotExistException(DatabaseObjectType type, String objectName) {
        super(type + " " + objectName + " " + ObjectDoesNotExistException.EXCEPTION_MESSAGE);
    }
}